package com.spider.admin.store.primary.model;

import com.spider.admin.conf.validator.UniqueValue;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;


@Getter
@Setter
@Validated
@Entity
@Table(name = "t_account_info")
@Accessors(chain = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class AccountInfo extends SuperVO {

    @Id
    private String pid;
    @NotEmpty(message = "账户名称不能为空", groups = Save.class)
    @UniqueValue(domainClass = AccountInfo.class, fieldName = "accountName", message = "账户名称不能重复", groups = Save.class)
    @Column(name = "account_name")
    private String accountName;
    //@NotEmpty(message = "账户密码不能为空", groups = Save.class)
    @Column(name = "password")
    private String password;
    @Column(name = "real_name")
    private String realName;
    @Column(name = "account_desc")
    private String accountDesc;
    @Column(name = "tenant_id")
    private String tenantId;
    @NotEmpty(message = "租户名称不能为空", groups = Save.class)
    @UniqueValue(domainClass = AccountInfo.class, fieldName = "tenantName", message = "租户名称不能重复", groups = {Save.class})

    @Column(name = "tenant_name")
    private String tenantName;
    //archive_status
    @Column(name = "archive_status")
    private String archiveStatus;

    @Column(name = "account_type")
    private Integer accountType;
}

